package com.maopuyu.taobaoapi;

import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;

public class TaoBaoSpdy2http implements IXposedHookLoadPackage {
    public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
        if (!lpparam.packageName.contains("taobao"))
            return;
        findAndHookMethod("mtopsdk.mtop.global.SwitchConfig", lpparam.classLoader,
                "isGlobalSpdySwitchOpen", new XC_MethodHook() {
            @Override
            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                param.setResult(false);
            }

            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                return;
            }
        });

    }
}
